package com.drivers.wallet;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan("com.drivers.wallet.mapper")
@Slf4j
public class WalletApplication {
    public static void main(String[] args) {
        SpringApplication.run(WalletApplication.class, args);
        log.info("启动成功");
    }

    @Bean
    public Redisson redisson(){
//        此为单机模式
        Config config = new Config();
        config.useSingleServer().setAddress("redis://122.51.129.189:6379").setDatabase(0);
        return (Redisson) Redisson.create(config);
    }
}